<?php
/**
 * Created by PhpStorm.
 * User: zhangyurong
 * Date: 2016/8/26
 * Time: 17:41
 */
namespace App\Http\Controllers\Common;
use App\Models\Common\CollTwoOption;
use Illuminate\Http\Request;

class OptionTwoController extends CommonController{
    /**
     * @param $sign
     * @return \Illuminate\Http\JsonResponse
     * 说明:打印json
     */
    public function twoOptions(Request $request){
        $sign = $request->input('sign');
        $pid = $request->input('selectPid');
        $CollTwoOption=CollTwoOption::where('sign',$sign)->where('pid',$pid)->orderBy('cid','asc')->get()->toArray();
        $selectArr = [];
        foreach($CollTwoOption as $v){
            $selectArr[] = array(
                "value" => $v['cid'],
                "text" => $v['en_name']
            );
        }
        return response()->json($selectArr);
    }
}